<template>
	<view class="all">
		 <view class="daohang">
			 <view v-for="(item,index) in daohang" data-index="{{index}}" class="dangedaohang" @click="click">
				 <view>{{item}}</view>
			 </view>
		 </view>
		  <chozhi v-if="show==1"></chozhi>
		  <jifenshangcheng v-if="show==2"></jifenshangcheng>
	</view>
</template>

<script>
	import chozhi from "@/pages/index/shangcheng/chongzhi"
	import jifenshangcheng from "@/pages/index/shangcheng/jifenshangcheng"
	
	export default {
		components:{
			chozhi,
			jifenshangcheng
		},
		data() {
			return {
				daohang:["充值","积分兑换"],
				show:2
			}
		},
		methods: {
			click(event){
				 if(this.daohang[event.currentTarget.dataset.index]=="充值")
				    this.show=1
				 else if(this.daohang[event.currentTarget.dataset.index]=="积分兑换")
				 this.show=2
				 
			}
		}
	}
</script>

<style>
     .all{
		background-color: antiquewhite;
		 height:378rpx ;
	 }
	 .daohang{
		display: flex;
		flex-direction: column;
		align-items: center;
		width: 150rpx;
		border: 1rpx solid antiquewhite ;
		
	 }
	 .dangedaohang{
		 width: 150rpx;
		 height: 70rpx;
		 border: 1rpx solid aquamarine;
		 font-size: 30rpx;
		 text-align:center;
		 line-height: 70rpx;
		 
	 }
</style>
